package cn.ricecode.restructure.design.chain;

public class ChainPatternMain {

    public static AbstractLogger initChain(){
        InfoLogger infoLogger=new InfoLogger();
        DebugLogger debugLogger=new DebugLogger();
        ErrorLogger errorLogger=new ErrorLogger();

        infoLogger.setNextLogger(debugLogger);
        debugLogger.setNextLogger(errorLogger);

        return infoLogger;
    }

    public static void main(String[] args) {
        AbstractLogger chain = initChain();
        chain.loadMessage(LoggerConstant.DEBUG);

    }
}
